import React, { Component } from 'react'
import usermodel from './usercontorlmodel/usermodel'
interface Iprops{
  list:Array<usermodel>
  del:(id:number)=>void
}
export default class UserContent extends Component<Iprops> {
    constructor(props:any){
      super(props)
    }
  render() {
    return (
      <div>
      {this.props.list.map((item:any) => (
             <div className="tr" key={item.id}>
               <div className="td">
                 <div>{item.id}</div>
                 <div>{item.username}</div>
                 <div>{item.password}</div>
                 <div
                   onClick={() => {
                     this.props.del(item.id as number);
                   }}
                 >
                   删除
                 </div>
               </div>
             </div>
           ))}
     </div>
    )
  }
}




